import axios from 'axios'

export function getRestaurantList(params) {
  return axios.get('/restaurant/list', { params })
}

export function getRestaurantDetail(id) {
  return axios.get(`/restaurant/${id}`)
}

export function getRestaurantMenu(id) {
  return axios.get(`/restaurant/${id}/menu`)
}

// 管理端接口
export function createRestaurant(data) {
  return axios.post('/admin/restaurant', data)
}

export function updateRestaurant(id, data) {
  return axios.put(`/admin/restaurant/${id}`, data)
}

export function deleteRestaurant(id) {
  return axios.delete(`/admin/restaurant/${id}`)
}

export function getAdminRestaurants() {
  return axios.get('/admin/restaurant')
}

export function updateRestaurantStatus(id, status) {
  return axios.put(`/admin/restaurant/${id}/status`, { status })
}

